<template>
	<el-card id="sss">
  <my-table :path="path" :data="data" :cols="cols" :formObj="form" :rules="rules" :tableAttrs="tableAttrs" :page-size="pageSize" :pageParams="pageParams" @show-dialog="showDlg">
    <template v-slot:form>
      <el-form-item label="用户名" prop="username">
        <el-input v-model="form.username" placeholder="用户名" clearable></el-input>
      </el-form-item>
      <el-form-item label="姓名" prop="name">
        <el-input v-model="form.name" placeholder="姓名" clearable></el-input>
      </el-form-item>
     
    </template>
	<template v-slot:buttons>
	</template>
  </my-table>

  <el-link type="info" style="padding: 5%;">新增默认密码 1234</el-link>
  </el-card>
</template>

<script>
  import myTable from '../components/myTable.vue'
  export default {
    components:{myTable},
    data() {
      return {
        data:{
          username:'',
          name:''
        },
        path:'/teacher',
        cols:[
          {property:'username',label:'用户名'},
          {property:'name',label:'姓名'}
        ],
        form:{
          username:'',
          name:''
        },
        rules: {
          username: [{
            required: true,
            message: '账号必填',
            trigger: 'blur'
          }],
          name: [{
            required: true,
            message: '姓名必填',
            trigger: 'blur'
          }]
        },
        tableAttrs:{
          border:true
        },
        pageSize:[3,10,20,50],
        pageParams:{
          limit:3
        }
      }
    },
    methods:{
      showDlg(form){
        console.log(form);
      }
    },
    mounted() {
        console.log(this.data)
    }
  }
</script>

<style scoped>
	#sss{
		min-height:99%;
	}
</style>
